using Business.GoodsManagement;
using Business.GoodsManagement.Dto;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;

namespace Business.Controllers
{
    [RemoteService]
    [Area("Business")]
    [Route("api/app/Goods")]
    public class GoodsController : AbpController
    {
        private readonly IGoodsAppService _GoodsAppService;

        public GoodsController(IGoodsAppService GoodsAppService)
        {
            _GoodsAppService = GoodsAppService;
        }

        [HttpPost]
        [Route("data-post")]
        public Task<GoodsDto> DataPost(CreateOrUpdateGoodsDto input)
        {
            return _GoodsAppService.DataPost(input);
        }

        [HttpPost]
        [Route("delete")]
        public Task Delete(List<Guid> ids)
        {
            return _GoodsAppService.Delete(ids);
        }

        [HttpGet]
        [Route("{id}")]
        public Task<GoodsDto> Get(Guid id)
        {
            return _GoodsAppService.Get(id);
        }

        [HttpGet]
        public Task<PagedResultDto<GoodsDto>> GetAll(GetGoodsInputDto input)
        {
            return _GoodsAppService.GetAll(input);
        }
    }
}
